package com.chennan.javabase.domain.list;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * @author chennan
 * @createTime 2022年02月25日 17:21:00
 */
public class ListSort {
    public static void main(String[] args) {
        List<Person> list = new ArrayList<>();
        list.add(new Person("131jkui3",11));
        list.add(new Person("131qqqe3",-1));
        list.add(new Person("131rr3",3));
        list.add(new Person("131ee3",8));
        list.add(new Person("131euu3",2));
        list.add(new Person("1qq",-5));
        System.out.println(list);
        list.sort(Comparator.comparing(Person::getAge));
        System.out.println(list);
    }
}
